<div class="bjui-pageHeader">
    <form action="{:U($Think.ACTION_NAME)}" method="POST" class="pageForm" data-toggle="validate" data-reload="true">
            <input type="hidden" name="act" value="add" />
            <input type="hidden" name="data[type]" value="{:I('get.type')}" />
            <select name="data[fid]" data-toggle="selectpicker" data-rule="required">
                <option value="">请选择分类</option>
                <option value="0">顶级分类</option>
                <volist name="list" id="vo">
                    <option value="{$vo.cid}">{$vo.fullname}</option>
                </volist>
            </select>
            <input placeholder="你要添加的分类名称" type="text" name="data[name]" value="" data-rule="required" />
            <input placeholder="你要添加的分类描述" type="text" name="data[description]" value="" />
            <button type="submit" class="btn-default">确定添加</button>
    </form>
</div>

<div class="bjui-pageContent">
    <!-- 内容区 -->
    <table class="table table-bordered table-hover table-striped table-top" data-layout-h="0" data-selected-multi="true">
        <thead>
            <tr>
                <th>ID</th>
                <th>原分类结构</th>
                <th>操作属性</th>
                <th>新分类</th>
                <th>分类名称</th>
                <th>排序</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <volist name="list" id="tree">
                <form action="{:U($Think.ACTION_NAME)}" class="pageForm" data-toggle="validate" data-reload="true">
                    <input type="hidden" name="data[type]" value="{:I('get.type')}" />
                    <input type="hidden" name="data[cid]" value="{$tree.cid}" />
                    <tr>
                        <td>{$tree.cid}</td>
                        <td>
                            <if condition="$tree.fid eq 0"><b>{$tree.fullname}</b>
                                <else/>{$tree.fullname}</if>
                        </td>
                        <td>
                            <select name="act" data-toggle="selectpicker" class="act">
                                <option selected="selected" value="edit">修改分类</option>
                                <option value="del">删除分类</option>
                                <option value="add">添加子类</option>
                            </select>
                        </td>
                        <td>
                            <select name="data[fid]" data-toggle="selectpicker">
                                <option value="0">顶级分类</option>
                                <volist name="list" id="vo1">
                                    <if condition="$vo1['cid'] eq $tree['cid']">
                                        <option value="{$vo1.cid}" selected="selected" readonly>{$vo1.fullname}</option>
                                        <else/>
                                        <option value="{$vo1.cid}">{$vo1.fullname}</option>
                                    </if>
                                </volist>
                            </select>
                        </td>
                        <td>
                            <input type="text" value="{$tree.name}" name="data[name]" placeholder="新的分类名称" size="20" />
                        </td>
                        <td>
                            <input type="text" value="{$tree.oid}" name="data[oid]" placeholder="排序" size="5" />
                        </td>
                        <td>
                            <button type="submit" class="btn-default">确定</button>
                        </td>
                    </tr>
                </form>
            </volist>
        </tbody>
    </table>
</div>